/****** Object:  Stored Procedure dbo.spr_UpdateExDBUserRolesByPK  ******/

 use [TourIS]
 GO

 if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[spr_UpdateExDBUserRolesByPK]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
 drop procedure [dbo].[spr_UpdateExDBUserRolesByPK]
 GO

 SET QUOTED_IDENTIFIER OFF
 GO
 SET ANSI_NULLS OFF
 GO

 CREATE  PROCEDURE [dbo].[spr_UpdateExDBUserRolesByPK]
 (
	@orig_roleid int,
	@roleid int,
	@orig_userid int,
	@userid int
 )

 AS

 BEGIN
	SET NOCOUNT ON
	DECLARE @Err int

	UPDATE [UserRoles]
	SET
		[RoleId] = @roleid,
		[UserId] = @userid

	WHERE
	[RoleId] = @orig_roleid
	AND [UserId] = @orig_userid


	SET @Err = @@Error
	RETURN @Err
 END

 SET QUOTED_IDENTIFIER OFF
 GO
 SET ANSI_NULLS ON
 GO

